On the Variance of Quickselect
نویسندگان
چکیده
Quickselect with median-of-three is routinely used as the method of choice for selection of the mth element out of n in general-purpose libraries such as the C++ Standard Template Library. Its average behavior is fairly well understood and has been shown to outperform that of the standard variant, which chooses a random pivot on each stage. However, no results were previously known about the variance of the median-of-three variant, other than for the number of comparisons made when the rank m of the sought element is given by a uniform random variable. Here, we consider the variance of the number of comparisons made by quickselect with median-of-three and other quickselect variants when selecting the mth element for m/n → α as n → ∞. We also investigate the behavior of proportion-from-s sampling as s → ∞.
منابع مشابه
QUICKSELECT Revisited
We give an overview of the running time analysis of the random divide-and-conquer algorithm FIND or QUICKSELECT. The results concern moments, distribution of FIND’s running time, the limiting distribution, a stochastic bound and the key: a stochastic fixed point equation.
متن کاملAn Extended Note on the Comparison-optimal Dual-Pivot Quickselect
In this note the precise minimum number of key comparisons any dual-pivot quickselect algorithm (without sampling) needs on average is determined. The result is in the form of exact as well as asymptotic formulæ of this number of a comparison-optimal algorithm. It turns out that the main terms of these asymptotic expansions coincide with the main terms of the corresponding analysis of the class...
متن کاملOn Quickselect, partial sorting and Multiple Quickselect
We present explicit solutions of a class of recurrences related to the Quickselect algorithm. Thus we are immediately able to solve recurrences arising at the partial sorting problem, which are contained in this class. We show how the partial sorting problem is connected to the Multiple Quickselect algorithm and present a method for the calculation of solutions for a class of recurrences relate...
متن کاملPartitioning schemes for quicksort and quickselect
We introduce several modifications of the partitioning schemes used in Hoare’s quicksort and quickselect algorithms, including ternary schemes which identify keys less or greater than the pivot. We give estimates for the numbers of swaps made by each scheme. Our computational experiments indicate that ternary schemes allow quickselect to identify all keys equal to the selected key at little add...
متن کاملChunksort: A Generalized Partial Sorting Algorithm
We introduce here the problem of generalized partial sorting and chunksort, an algorithm closely related to quicksort and quickselect that solves this problem in an elegant and efficient way. In generalized partial sorting we are given an array of n elements and p intervals I1 = [`1,u1], I2 = [`2,u2], . . . , Ip = [`p,up], which define p blocks in the array and p+1 gaps between the blocks. The ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2006